d/p/2018.1/tests-Assert-that-byte-order-[etc.].patch: Add patch to fix test failures...
authorSimon McVittie <smcv@debian.org>
Thu, 4 Jan 2018 13:01:49 +0000 (13:01 +0000)
committerSimon McVittie <smcv@debian.org>
Thu, 4 Jan 2018 13:01:49 +0000 (13:01 +0000)
debian/changelog
debian/patches/2018.1/tests-Assert-that-byte-order-is-swapped-on-LE-but-not-BE-.patch [new file with mode: 0644]
debian/patches/series

index bd2be187c0befae37fad4a445cbf8195e11e09d2..8e953ea3bb704cfb2e8ef15416d819aeadb4ee9b 100644 (file)
@@ -2,6 +2,9 @@ ostree (2017.15-2) UNRELEASED; urgency=medium
 
   * d/p/2018.1/tests-Don-t-assume-uid-primary-gid.patch: Mark as applied
     upstream in 2018.1
+  * d/p/2018.1/tests-Assert-that-byte-order-[etc.].patch:
+    Add patch to fix test failures on big-endian machines
+    (Closes: #886218)
 
  -- Simon McVittie <smcv@debian.org>  Thu, 04 Jan 2018 12:58:50 +0000
 
diff --git a/debian/patches/2018.1/tests-Assert-that-byte-order-is-swapped-on-LE-but-not-BE-.patch b/debian/patches/2018.1/tests-Assert-that-byte-order-is-swapped-on-LE-but-not-BE-.patch
new file mode 100644 (file)
index 0000000..1c65923
--- /dev/null
@@ -0,0 +1,79 @@
+From: Simon McVittie <smcv@collabora.com>
+Date: Wed, 3 Jan 2018 08:23:10 +0000
+Subject: tests: Assert that byte-order is swapped on LE but not BE CPUs
+
+Closes: #1392
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+Closes: #1393
+Approved by: cgwalters
+Applied-upstream: 2018.1, commit:https://github.com/ostreedev/ostree/commit/994cd66744e559c92644f36028c6c262605ad75a
+---
+ Makefile-tests.am      |  8 +++++++-
+ tests/basic-test.sh    | 14 +++++++++++++-
+ tests/get-byte-order.c | 12 ++++++++++++
+ 3 files changed, 32 insertions(+), 2 deletions(-)
+ create mode 100644 tests/get-byte-order.c
+
+diff --git a/Makefile-tests.am b/Makefile-tests.am
+index 2b33555..25a8d08 100644
+--- a/Makefile-tests.am
++++ b/Makefile-tests.am
+@@ -130,7 +130,13 @@ experimental_test_scripts = \
+       tests/test-summary-collections.sh \
+       tests/test-pull-collections.sh \
+       $(NULL)
+-test_extra_programs = $(NULL)
++test_extra_programs = \
++      tests/get-byte-order \
++      $(NULL)
++
++tests_get_byte_order_SOURCES = tests/get-byte-order.c
++tests_get_byte_order_CFLAGS = $(AM_CFLAGS) $(GLIB_CFLAGS)
++tests_get_byte_order_LDADD = $(GLIB_LIBS)
+ tests_repo_finder_mount_SOURCES = tests/repo-finder-mount.c
+ tests_repo_finder_mount_CFLAGS = $(common_tests_cflags)
+diff --git a/tests/basic-test.sh b/tests/basic-test.sh
+index 87cb9fa..c4eb9ca 100644
+--- a/tests/basic-test.sh
++++ b/tests/basic-test.sh
+@@ -759,8 +759,20 @@ $OSTREE show --print-metadata-key=FOO test2 > test2-meta
+ assert_file_has_content test2-meta "BAR"
+ $OSTREE show --print-metadata-key=KITTENS test2 > test2-meta
+ assert_file_has_content test2-meta "CUTE"
++
+ $OSTREE show --print-metadata-key=SOMENUM test2 > test2-meta
+-assert_file_has_content test2-meta "uint64 3026418949592973312"
++case "$("${test_builddir}/get-byte-order")" in
++    (4321)
++        assert_file_has_content test2-meta "uint64 42"
++        ;;
++    (1234)
++        assert_file_has_content test2-meta "uint64 3026418949592973312"
++        ;;
++    (*)
++        fatal "neither little-endian nor big-endian?"
++        ;;
++esac
++
+ $OSTREE show -B --print-metadata-key=SOMENUM test2 > test2-meta
+ assert_file_has_content test2-meta "uint64 42"
+ $OSTREE show --print-detached-metadata-key=SIGNATURE test2 > test2-meta
+diff --git a/tests/get-byte-order.c b/tests/get-byte-order.c
+new file mode 100644
+index 0000000..7e7ba31
+--- /dev/null
++++ b/tests/get-byte-order.c
+@@ -0,0 +1,12 @@
++/* Helper for OSTree tests: return host byte order */
++
++#include "config.h"
++
++#include <glib.h>
++
++int
++main (void)
++{
++  g_print ("%d\n", G_BYTE_ORDER);
++  return 0;
++}
index c5896f0cab678f507a0eb7b8df858f8f4df2367c..18f048f7dd43d480b99cf42fca5b6d3296513f69 100644 (file)
@@ -1 +1,2 @@
 2018.1/tests-Don-t-assume-uid-primary-gid.patch
+2018.1/tests-Assert-that-byte-order-is-swapped-on-LE-but-not-BE-.patch